//package com.example.task;
//
//import cn.hutool.json.JSONUtil;
//import com.example.config.webscoket.WebSocket;
//import com.example.dao.*;
//import com.example.model.entity.*;
//import com.example.model.query.TEquipmentPartQuery;
//import com.example.model.query.TPlanRecordQuery;
//import com.example.model.vo.SocketVo;
//import com.example.service.SuppliesRealinfoService;
//import com.example.service.SuppliesService;
//import lombok.extern.slf4j.Slf4j;
//import org.springframework.beans.BeanUtils;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.scheduling.annotation.Scheduled;
//import org.springframework.stereotype.Component;
//import javax.annotation.Resource;
//
//@Component
//@Slf4j
//public class warningPushTask {
//
//    @Autowired
//    private SuppliesRealinfoService suppliesRealinfoService;
//
//    @Autowired
//    private SuppliesService suppliesService;
//
//    @Resource
//    private WebSocket webSocket;
//
//    @Autowired
//    private SuppliesPropMapper suppliesPropMapper;
//
//    @Autowired
//    private PocEventMapper pocEventMapper;
//
//    @Autowired
//    private TEquipmentPartMapper equipmentPartMapper;
//
//    @Autowired
//    private TEquipmentMapper equipmentMapper;
//
//    @Autowired
//    private TPlanMapper planMapper;
//
//    @Autowired
//    private TPlanRecordMapper planRecordMapper;
//    @Autowired
//    private TWarningMapper warningMapper;
//    @Scheduled(fixedRate = 15000)//15秒
//    public void pushTask() throws Exception {
//        if(webSocket.webSocketSet.size() ==0){
//            return;
//        }
//        /*----------告警-打开摄像头-------------*/
////        TPlanRecord planRecord = planRecordMapper.selectById("1350990087016140801");
////        TPlanRecordQuery query = new TPlanRecordQuery();
////        BeanUtils.copyProperties(planRecord,query);
////        TWarning warning = warningMapper.selectById(planRecord.getWarningId());
////        TEquipment equipment = equipmentMapper.selectById(warning.getEquipmentId());
////        query.setEquipment(equipment);
////        TEquipmentPart part1 = equipmentPartMapper.selectById(warning.getPartId());
////        query.setEquipmentPart(part1);
////        SocketVo vo  = new SocketVo();
////        vo.setSource("warning");
////        vo.setType("openVideo");//
////        vo.setData(JSONUtil.parseObj(query));
////        webSocket.GroupSending(JSONUtil.toJsonStr(vo));
//        /*----------告警-------------------------*/
//        TEquipmentPart part = equipmentPartMapper.selectById("1343455016436584450");//1343455016436584450，1339828681973669889
//        TEquipmentPartQuery query1= new TEquipmentPartQuery();
//        if(part != null){
//            BeanUtils.copyProperties(part,query1);
//            TEquipment equipment1 = equipmentMapper.selectById(part.getEquipmentId());
//            query1.setEquipmentName(equipment1.getEquipmentName());
//        }
//
//        SocketVo vo1  = new SocketVo();
//        vo1.setSource("warning");
//        vo1.setType("warning");//
//        vo1.setData(JSONUtil.parseObj(query1));
//        webSocket.GroupSending(JSONUtil.toJsonStr(vo1),"warning");
//    }
//}
//
